]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Properly check for TerminalEmulator in the Categories key
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 28 Jan 2014 17:09:35 +0000 (12:09 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 28 Jan 2014 18:32:36 +0000 (13:32 -0500)
get_categories() returns an unparsed string, not a list of categories.
We need to parse the list by splitting on ';' to deterine whether the
actual 'TerminalEmulator' category is in the list, rather than something
like 'X-GNOME-TerminalEmulator'. It's an edge case, but I need to split
the list properly for the new folders, so I might as well fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=723179

js/ui/appDisplay.js

index b30e49d1d51175eef88eabf34e7a5cc16aa64556..921d83b071680ff7a579bf136ba0bc0b148769f3 100644 (file)
@@ -46,11 +46,18 @@ const INDICATORS_ANIMATION_MAX_TIME = 0.75;
 const PAGE_SWITCH_TRESHOLD = 0.2;
 const PAGE_SWITCH_TIME = 0.3;
 
+function _getCategories(info) {
+    let categoriesStr = info.get_categories();
+    if (!categoriesStr)
+        return [];
+    return categoriesStr.split(';');
+}
+
 function _isTerminal(app) {
     let info = app.get_app_info();
     if (!info)
         return false;
-    let categories = info.get_categories() || [];
+    let categories = _getCategories(info);
     return categories.indexOf('TerminalEmulator') > -1;
 }